Skip to content

chore: lint with jarl#21

Merged
davidbenncsiro merged 1 commit intocsiro:mainfrom
spectral-cockpit:chore/lint-jarl
Jan 15, 2026
Merged

chore: lint with jarl#21
davidbenncsiro merged 1 commit intocsiro:mainfrom
spectral-cockpit:chore/lint-jarl

Conversation

@philipp-baumann
Copy link
Contributor

@philipp-baumann philipp-baumann commented Jan 14, 2026

do

jarl check R/ --fix

details here: https://r-consortium.org/posts/jarl-just-another-r-linter/

locally, I used this linting env using nix:

let
  pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz") {};

  # Override jarl to skip failing tests
  jarl = pkgs.jarl.overrideAttrs (oldAttrs: {
    doCheck = false;
  });

  rpkgs = builtins.attrValues {
    inherit (pkgs.rPackages)
      asdreader
      hyperSpec
      jsonlite
      knitr
      prospectr
      R6
      Rcpp
      rmarkdown
      stringr
      geometry
      clhs
      testthat
      devtools
      roxygen2
      lintr
      styler;
  };

  system_packages = builtins.attrValues {
    inherit (pkgs)
      R
      glibcLocalesUtf8;
  } ++ [ jarl ];
in

pkgs.mkShell {
  LOCALE_ARCHIVE = if pkgs.stdenv.hostPlatform.system == "x86_64-linux" then "${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive" else "";
  LANG = "en_US.UTF-8";
  LC_ALL = "en_US.UTF-8";
  LC_TIME = "en_US.UTF-8";
  LC_MONETARY = "en_US.UTF-8";
  LC_PAPER = "en_US.UTF-8";
  LC_MEASUREMENT = "en_US.UTF-8";

  buildInputs = [ system_packages rpkgs ];

}

@philipp-baumann philipp-baumann changed the title chore: lint with yarl chore: lint with jarl Jan 14, 2026
@philipp-baumann
Copy link
Contributor Author

@davidbenncsiro this is just a little first PR. More will follow :)

@davidbenncsiro davidbenncsiro self-requested a review January 15, 2026 01:33
spec.df <-
data.frame(wavenumber=as.integer(rownames(spec.data)),
intensity=spec.data[1:length(spec.data)])
intensity=spec.data[seq_along(spec.data)])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and seq_len are nice. Admit that I have not seen them before.

if (grepl(str, pattern="=", fixed = TRUE)) {
delimiter <- "="
} else if (grepl(str, pattern=":")) {
} else if (grepl(str, pattern=":", fixed = TRUE)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fair point.

sampDF <- specdf[idxS,]

for (j in 1:nrow(sampDF)) {
srec = sampDF[j,]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can at least say that this was not code I wrote. :) Easy to do though.

@davidbenncsiro
Copy link
Collaborator

@davidbenncsiro this is just a little first PR. More will follow :)

Happy to see this code improved. Thanks!

@davidbenncsiro
Copy link
Collaborator

jarl looks nice. Does the comment above re: "skip failing tests" refer to failing UTs?

@davidbenncsiro davidbenncsiro merged commit ab373d7 into csiro:main Jan 15, 2026
1 check passed
@philipp-baumann philipp-baumann deleted the chore/lint-jarl branch January 15, 2026 02:45
@philipp-baumann
Copy link
Contributor Author

jarl looks nice. Does the comment above re: "skip failing tests" refer to failing UTs?

yes exactly failing unit tests for jarl :) needed a fix/override, this was a quickfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants